home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / COMMUNIC / TERMINAL / 1589.ZIP / TERM.H < prev    next >
Text File  |  1989-04-12  |  8KB  |  232 lines

  1. /***********************************************************************
  2. ** IDM - ID for Menu commands
  3. ** IDS - ID for String table
  4. ** IDD - ID for Dialog item
  5. ***********************************************************************/
  6.  
  7. struct  relations
  8.    {
  9.    char   identifer[3];   /* Two letter identifer  */
  10.    char   sequence[20];   /* Character sequence    */
  11.    int    length      ;   /* Number of characters  */
  12.    int    meaning     ;   /* Meaning of sequence   */
  13.    }                  ;
  14.  
  15.  /* this trick allows externs to be put in one place */
  16. #ifndef EXTERN
  17. #define EXTERN extern
  18. extern struct relations emulate[];
  19. extern char LineColCodes[];
  20. #include "termdefs.h"
  21. #else
  22. #include "relate.h"
  23. #endif
  24.  
  25. /***************************/
  26. /* Dialog box resource ids */
  27. /***************************/
  28. #define TERMINAL       1
  29. #define ABOUTDIALOG    2
  30. #define DESCBOX        3
  31. #define PATHBOX        4
  32. #define CONFIGTERM     5
  33.  
  34. /* IDM... ID for Menus      */
  35. /* IDT... ID for Timers     */
  36. /* IDS... ID for Strings    */
  37. /* IDD... ID for Dialog Box */
  38.  
  39. #define IDMFLASH        0
  40. #define IDMCOMMANDS     1
  41. #define IDMABOUT        2
  42.  
  43. #define IDMDIALOG      13
  44. #define IDMCOLOR       14
  45. #define IDMSAVEWINDOW  16
  46. #define IDMON          20
  47. #define IDMOFF         21
  48. #define IDMCONFIG      22
  49. #define IDMCLEAR       23
  50. #define IDMFILE        24
  51. #define IDMCONNECT     25
  52.  
  53. #define IDTASYNC       30
  54. #define IDTFLASH       31
  55.  
  56. /* max number of chars in the associated strings in the rc file */
  57. #define CCHMAXSTRING 50
  58.  
  59. /****************************************
  60. * String Table definations
  61. ****************************************/
  62. #define IDSCONTENT     101
  63. #define IDSCLOSE       102
  64. #define IDSOKCLOSE     103
  65. #define IDSSAVE        104
  66. #define IDSOKSAVE      105
  67. #define IDSASYNC       106
  68. #define IDSOKASYNC     107
  69. #define IDSAPPNAME     108
  70. #define IDSABOUT       109
  71. #define IDSTITLE       110
  72. #define IDSDEFAULT     111
  73. #define IDSWINDOWNAME  112
  74. #define IDSMAINTITLE   113
  75. #define IDSCONFIGPATH  114
  76. #define IDSCAPTURE     115
  77.  
  78.  
  79. /****************************************
  80. * Dialog Window Definations
  81. ****************************************/
  82. #define IDNULL        -1
  83. #define IDDDEFAULTS  101
  84. #define IDDTEXT      102
  85. #define IDDCHECKBOX  103
  86. #define IDDNULL      104
  87. #define IDDRBLEFT    105
  88. #define IDDRBRIGHT   106
  89. #define IDDRBCENTER  107
  90. #define IDDLISTBOX   108
  91. #define IDDSBH       109
  92. #define IDDREQTYPE   110
  93. #define IDDREQSTRG   111
  94. #define IDDIMGLIST   112
  95. #define IDDPATHNAME  113
  96. #define IDDLIST      114
  97. #define IDDPB1       115
  98. #define IDDPB2       116
  99. #define IDDPB3       117
  100. #define IDD300       118
  101. #define IDD1200      119
  102. #define IDD9600      120
  103. #define IDDSMALL     121
  104. #define IDDMED1      122
  105. #define IDDMED2      123
  106. #define IDDLARGE     124
  107. #define IDDCOM1      125
  108. #define IDDCOM2      126
  109. #define IDDCOM3      127
  110. #define IDDCOM4      128
  111. #define IDDFLASH     129
  112. #define IDDBEEP      130
  113. #define IDDDISPLAY   131
  114. #define IDDOPEN      132
  115.  
  116. /****************************************
  117. * SELECTDLG defines                     *
  118. ****************************************/
  119. #define MSG_BEEP     300 /* action to take when a message is seen while iconic*/
  120. #define MSG_OPEN     301
  121. #define MSG_FLASH    302
  122. #define MSG_DISP     303
  123.  
  124. /* count of msec for async message box and window flash rate */
  125. #define CMSECASYNC 10000
  126. #define CMSECFLASH  1000
  127.  
  128. #define ICON_RATE  10000
  129. #define FLASH_RATE  1000
  130. #define OPEN_RATE      1
  131. #define ICON_TIMER     1                /* id of timer used when wind iconic*/
  132. #define OPEN_TIMER     2                /* timer when window is open        */
  133. #define FLASH_TIMER    3                /* timer used when icon flashing    */
  134. #define IN_QUEUE    1024                /* input and output buffers for the */
  135. #define OUT_QUEUE   1024                /*   serial port                    */
  136. #define MAX_LINES     32                /* maximum no. of lines in terminal */
  137. #define MAX_COLS     100                /* maximum no. of columns in term   */
  138. #define NEXT_LINE    156
  139. #define NEXT_CHAR    176
  140. #define DOWN_LINE    177
  141.  
  142. #define CR          0x0d
  143. #define LF          0x0a
  144. #define BS          0x08
  145. #define ESC         0x1b
  146. /*********************************************************************
  147. **  These procedures must be declared FAR, even if this application
  148. **  were SMALL model, because they are exported and called by windows.
  149. *********************************************************************/
  150.  
  151. BOOL FAR PASCAL TermAboutDlg (HWND, unsigned, WORD, LONG);
  152. BOOL FAR PASCAL DescDlg      (HWND, unsigned, WORD, LONG);
  153. BOOL FAR PASCAL SelectDlg    (HWND, unsigned, WORD, LONG);
  154. long FAR PASCAL TermWndProc  (HWND, unsigned, WORD, LONG);
  155. BOOL FAR PASCAL Timer        (HWND, unsigned, WORD, LONG);
  156. BOOL FAR PASCAL ConfigTerm   (HWND, unsigned, WORD, LONG);
  157.  
  158. /*********************************************************************
  159. **  These procedures are declared here to get type and parameter
  160. **  checking for calls between modules.  The compiler switches -AS and
  161. **  -AM for SMALL and MIDDLE model will make them NEAR and FAR
  162. **  respectively, so there is no explicit declaration as NEAR or FAR.
  163. *********************************************************************/
  164.  
  165. TermCharInput       (HWND, int, int);
  166. TermClose           (HWND);
  167.  
  168. TermCreate          (HWND);
  169. TermEndSession      (HWND, BOOL);
  170. TermEraseBkgnd      (HWND, HDC);
  171. TermGetFocus        (HWND, HWND);
  172. TermHorzScroll      (HWND, int, int);
  173. TermKeyInput        (HWND, unsigned, int);
  174. TermLoseFocus       (HWND, HWND);
  175. TermMouse           (HWND, unsigned, WORD, POINT);
  176. TermMove            (HWND, int, int);
  177. TermPaint           (HWND);
  178. TermQueryEndSession (HWND);
  179. TermSize            (HWND, int, int, int, long);
  180. long TermCommand    (HWND, unsigned, WORD, LONG);
  181. long TermSysCommand (HWND, unsigned, WORD, LONG);
  182. TermTimer           (HWND, WORD);
  183. TermVertScroll      (HWND, int, WORD);
  184. int FAR TermInit    (HANDLE, HANDLE, LPSTR, int);
  185. /********************************************************************/
  186. /*   GLOBALS */
  187.  
  188. typedef struct Display
  189.    {
  190.    HANDLE  Handle  ;
  191.    char    *string ;
  192.    }       DISPLAY ;
  193.  
  194. EXTERN  int       nCID, Capture, CaptureFD, CaptureLine;
  195. EXTERN  short     win_size, flashing, message_action, PaintWindow;
  196. EXTERN  short     width, height, ret;
  197. EXTERN  short     char_w, char_h;
  198. EXTERN  short     no_lines, no_cols;
  199. EXTERN  short     next_line, next_char;
  200. EXTERN  short     baud_rate, byte_size, parity, stop_bits, open_size, port;
  201. EXTERN  short     VerboseMessages, LogErrors, GraphicsMode;
  202. EXTERN  BOOL      TermHasFocus, CaretMode;
  203. EXTERN  char      port_name[6], ConfigPath[40];
  204. EXTERN  char      szAppName[20];
  205. EXTERN  char      buff[512], CaptureBuff[96];
  206. EXTERN  DISPLAY   display[MAX_LINES];
  207. EXTERN  struct    window_size win_sz;
  208. EXTERN  HBRUSH    hbrWhite;
  209. EXTERN  HBRUSH    hbrBlack;
  210. EXTERN  HANDLE    hCommHandle;
  211. EXTERN  HANDLE    hAccelTable;
  212. EXTERN  HANDLE    hInstTerm;
  213. EXTERN  HANDLE    hAccelTable;
  214. EXTERN  HCURSOR   hArrowCurs;
  215. EXTERN  HMENU     hMenuMain;
  216. EXTERN  HFONT     IBMfont;
  217. EXTERN  HWND      hWndTerm;
  218. EXTERN  HWND      hWdesc;
  219. EXTERN  FARPROC   lpprocTimer;
  220. EXTERN  FARPROC   lpprocDescDlg;
  221. EXTERN  FARPROC   lpprocSelectDlg;
  222. EXTERN  FARPROC   lpprocConfigTerm;
  223. EXTERN  FARPROC   lpprocTermAboutDlg;
  224. EXTERN  PAINTSTRUCT  ps;
  225. EXTERN  BOOL      fDoFlash;
  226. EXTERN  POINT     curs_pos;         /* current position of cursor    */
  227. EXTERN  RECT      rect;
  228. EXTERN  HDC       hTermDC;
  229. EXTERN  DCB       *DCBPtr;
  230. extern  short     errno;
  231.  
  232.